home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -websites- / haage&partner / ftp / classx / fm3-demo.lha / FM3-DEMO / Rexx / TUT_FontOro.rexx < prev    next >
OS/2 REXX Batch file  |  1997-08-29  |  4KB  |  160 lines

  1. /******************************************************************/
  2. /* ClassX Amiga Rexx script - Copyright © 1997 ClassX Development */
  3. /******************************************************************/
  4.  
  5. /*
  6.     $VER: TUT_FontOro.rexx 3.0
  7. */
  8.  
  9. /*
  10. #ITA "Tutorial Font Dorato"
  11. #INF "Esempio guidato interattivo per la"
  12. #INF "creazione di un font dorato."
  13. #END
  14. */
  15.  
  16. /*
  17. #ENG "Tutorial Golden Font"
  18. #INF "Interactive guided example to"
  19. #INF "create a golden-looking font."
  20. #END
  21. */
  22.  
  23.  
  24. MYPORT = 'FontMachine'
  25.  
  26. IF ~SHOW('P', MYPORT) THEN DO
  27.     IF EXISTS('FontMachine:FontMachine') THEN DO
  28.         ADDRESS COMMAND 'Run >NIL: FontMachine:FontMachine'
  29.         DO 30 WHILE ~SHOW('P',MYPORT)
  30.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  31.         END
  32.     END
  33.     ELSE DO
  34.         SAY "FontMachine could not be loaded."
  35.         EXIT 10
  36.     END
  37. END
  38.  
  39. IF ~SHOW('P', MYPORT) THEN DO
  40.     SAY 'FontMachine Rexx port could not be opened.'
  41.     EXIT 10
  42. END
  43.  
  44. ADDRESS VALUE MYPORT
  45. OPTIONS RESULTS
  46. OPTIONS FAILAT 10000
  47.  
  48. /* Make sure rexxsupport library is opened */
  49. IF ~SHOW('L','rexxsupport.library') THEN CALL ADDLIB('rexxsupport.library',0,-30)
  50.  
  51. /******************************************************************/
  52.  
  53. LockGui
  54.  
  55. /* language support */
  56. GetLocale
  57. Select 
  58.     /* italiano */
  59.     when FM_RESULT = "ITA" then do
  60.         TXT_01 = '"Tutorial: come costruire un font Dorato"'
  61.         TXT_02 = '"Risoluzione 16 colori"'
  62.         TXT_03 = '"Caricare font Balloon di 100 punti"'
  63.         TXT_04 = '"Tessitura di fronte Plasma 100x100 Gold."'
  64.         TXT_05 = '"Tessitura di bordo Pattern 100x100 Gold Linear30."'
  65.         TXT_06 = '"Ottimizzare la palette."'
  66.         TXT_07 = '"Settare il colore di sfondo (0) con il blu."'
  67.         TXT_08 = '"Settare mappatura tessiture a Solido RndMap (mappatura casuale)"'
  68.         TXT_09 = '"Settare la tessitura di bordo a 3 punti"'
  69.         TXT_10 = '"Pronto ! Vuoi salvare il ColorFont ?"'
  70.         TXT_11 = '"Ok|Annulla"'
  71.         TXT_12 = '"Fine Tutorial"'
  72.     end
  73.  
  74.     /* english or default language */
  75.     when FM_RESULT = "ENG" then do
  76.         TXT_01 = '"Tutorial: how to make a Golden font"'
  77.         TXT_02 = '"Set resolution to 16 colours"'
  78.         TXT_03 = '"Load font Balloon, 100 points"'
  79.         TXT_04 = '"Load front texture Plasma 100x100 Gold"'
  80.         TXT_05 = '"Load border texture Pattern 100x100 Gold Linear30"'
  81.         TXT_06 = '"Optimize the palette"'
  82.         TXT_07 = '"Set the background colour (0) with blu"'
  83.         TXT_08 = '"Set texture mapping to Solid RndMap (random mapping)"'
  84.         TXT_09 = '"Set the border texture to 3 pixels"'
  85.         TXT_10 = '"Ready. Do you want to save the ColorFont ?"'
  86.         TXT_11 = '"Ok|Cancel"'
  87.         TXT_12 = '"End Tutorial"'
  88.     end
  89. end
  90.  
  91. FreeTexture FRONT
  92. FreeTexture BORDER
  93. SetAttr "Emboss" 0
  94. SetAttr "Bevel" 0
  95. SetAttr "3D" 0
  96. SetAttr "Shadow" 0
  97. SetAttr "Outline" 0
  98. SetAttr "OutTexture" 0
  99.  
  100. Request '"FontMachine"' TXT_01 'Ok'
  101. Request '"FontMachine"' TXT_02 'Ok'
  102. Resolution 4
  103.  
  104. Request '"FontMachine"' TXT_03 'Ok'
  105. LoadFont "Balloon.font" 100
  106. CALL WaitRedraw (FM_RESULT)
  107.  
  108. Request '"FontMachine"' TXT_04 'Ok'
  109. LoadTexture "Front" "Plasma" 100 100 0
  110. CALL WaitRedraw (FM_RESULT)
  111.  
  112. Request '"FontMachine"' TXT_05 'Ok'
  113. LoadTexture "Border" "Pattern" 100 100 0 "Linear30"
  114. CALL WaitRedraw (FM_RESULT)
  115.  
  116. Request '"FontMachine"' TXT_06 'Ok'
  117. OptimizePal
  118.  
  119. Request '"FontMachine"' TXT_07 'Ok'
  120. EditPal 0 0 0 180 
  121. CALL WaitRedraw (FM_RESULT)
  122.  
  123. Request '"FontMachine"' TXT_08 'Ok'
  124. SetMapMode "SolidMappedRnd" 3
  125. CALL WaitRedraw (FM_RESULT)
  126.  
  127. Request '"FontMachine"' TXT_09 'Ok'
  128. SetAttr "OutTexture" 3
  129. CALL WaitRedraw (FM_RESULT)
  130.  
  131. Request '"FontMachine"' TXT_10 TXT_11
  132. IF (FM_RESULT) THEN DO    
  133.     SaveFont "Fonts:BalloonC" "106.16C"
  134.     IF (RC) THEN DO
  135.         Request '"ARexx Error"' '"'FM_ERROR'"' 'Ok'
  136.     END
  137.     CALL WaitRedraw (FM_RESULT)
  138. END
  139.  
  140. Request '"ARexx Message"' TXT_12 'Ok'
  141.  
  142. UnLockGui
  143. EXIT
  144.  
  145.  
  146. /******************************************************************/
  147.  
  148. WaitRedraw:
  149.     ARG Res
  150.     /* wait the rendering of the font */
  151.     DO WHILE Res ~= 0
  152.         CheckRedraw
  153.         Res = FM_RESULT
  154.         ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  155.     END
  156.     RETURN
  157.  
  158.  
  159. /******************************************************************/
  160.